<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>
        项目信息-跟踪阶段
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../../css/main.css" media="all">
    <link rel="stylesheet" href="../../../../lib/layui2.0/css/layui.css" media="all">
    <script type="text/javascript" src="../../../../lib/loading/okLoading.js"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="../../../../js/xm-select.js"></script>

</head>
<!--借还流水-->
<style>
    .layui-form-label {
        width: 150px !important;
    }
</style>

<body>
<div class="x-nav">
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon"
                                                                        style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body" id="app">
    <div class="main_box">
        <div class="panel-heading">
            <ul class="nav nav-tabs" id="navTabs">
                <li class=""><a class="receivePane" data-tab=""  href="#" onclick="p_admin_add('项目详情','essential_information/essential_information.html?recordId='+recordId +'&businessTypeId=' + businessTypeId,'1200','600')">基本信息</a></li>
                <li class=""><a class="payPane" data-tab="" href="#" onclick="p_admin_add('项目详情','personnel_information/personnel_information.html?recordId='+recordId +'&businessTypeId=' + businessTypeId,'1200','600')">人员信息</a></li>
                <li class="active"><a class="payPane" data-tab="" href="#" onclick="p_admin_add('项目详情','tracking_phase.html?recordId='+recordId +'&businessTypeId=' + businessTypeId,'1200','600')">跟踪阶段</a></li>
                <li class=""><a class="payPane" data-tab="" href="#" onclick="p_admin_add('项目详情','visit_records/visit_records.html?recordId='+recordId +'&businessTypeId=' + businessTypeId,'1200','600')">拜访记录</a></li>
                <li class=""><a class="payPane" data-tab="" href="#" onclick="p_admin_add('项目详情','project_log/project_log.html?recordId='+recordId +'&businessTypeId=' + businessTypeId,'1200','600')">项目日志</a></li>



            </ul>
        </div>
    </div>
    <div class="header_add">

        <div style="text-align: right;" class="layui-form-item">
            <button class="layui-btn" type="button" onclick="p_admin_add('调整阶段','tracking_phase/adjustment_phase.html?Id='+recordId,'600','300')">
                调整阶段
            </button>
        </div>
        <div class="layui-tab layui-tab-card"  lay-filter="tab" id="aaaaaa">
            <ul class="layui-tab-title">


            </ul>
            <div class="layui-tab-content" >


            </div>
        </div>

    </div>


</div>
<script type="text/javascript" src="../../../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../../../js/myAjax.js"></script>
<script type="text/javascript" src="../../../../js/pub.js"></script>
<script src="../../../../lib/layui/layui-v2.5.7/layui/layui.js" charset="utf-8"></script>
<script src="../../../../js/x-layui.js" charset="utf-8"></script>
<script src="../../../../js/vue.min.js" charset="utf-8"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>

<script>
    layui.use(['element', 'layer', 'form', 'laydate'], function () {
        $ = layui.jquery;//jquery
        element = layui.element;//面包导航
        layer = layui.layer;//弹出层
        laydate = layui.laydate;//日期插件
        form = layui.form;

    })

</script>
<script>

    var recordId = getQueryVariable("recordId");
    var businessTypeId=getQueryVariable("businessTypeId");

    layui.use(['laydate', 'form', 'layer','upload','element'],
        function () {
            var form = layui.form;
            okLoading.close($);
            var layer = layui.layer;
            var laydate = layui.laydate;
            var upload = layui.upload;
            var element = layui.element;
            console.log(element);


            var uploadInst = upload.render({
                elem: '#sgxc' //绑定元素
                ,url: '/upload/' //上传接口
                ,done: function(res){
                    //上传完毕回调
                }
                ,error: function(){
                    //请求异常回调
                }
            });

            let request = {
                url: "xa/project/findProjectStage",
                data: {
                    userId: $userId,
                    projectId:recordId,

                },

            };
            sendRequest(request, (data) => {
                console.log(data);
                this.statistics = data.data.stageList;
                var zy=data.data.project.belongStageId;

                console.log( this.statistics);
                for (let key in this.statistics){
                    console.log(this.statistics[key]);
                        var url="tracking_phase_1.html?recordId="+recordId+"&tabId="+this.statistics[key].id+"&stageName="+ encodeURI(this.statistics[key].name);
                        element.tabAdd('tab', {
                            title: this.statistics[key].name
                            ,content: ' <iframe src="'+url+'"  frameborder="0" width="100%" height="700px" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>'
                            ,id: this.statistics[key].id
                        });
                }
                if(zy===0){
                    element.tabChange('tab', this.statistics[0].id);
                }else {

                    element.tabChange('tab', zy);
                }

            });


        });



    function p_admin_add(title,url,w,h){
        p_admin_show(title,url,w,h);
    }


</script>

<script>

    var vm = new Vue({
        el: "#app",
        data: {
            statistics: {},

        },
        mounted() {
            this.statisticsFun();
        },
        methods: {

            bindSrcBillAttachment(value) {
                return $baseUrl +
                    'other/viewUploadFile2?id=' + value;
            },

            statisticsFun() {



            }
        }

    });

</script>

</body>

</html>
